package org.example.POJO.game;

public class ChessFactory {
    private ChessFactory() {

    }

    public static Chess create(String name, int camp, int px) {
        if ("wang".equals(name)) {
            return new Wang(camp, px);
        } else if ("shi".equals(name)) {
            return new Shi(camp, px);
        } else if ("xiang".equals(name)) {
            return new Xiang(camp, px);
        } else if ("ma".equals(name)) {
            return new Ma(camp, px);
        } else if ("che".equals(name)) {
            return new Che(camp, px);
        } else if ("pao".equals(name)) {
            return new Pao(camp, px);
        } else if ("bing".equals(name)) {
            return new Bing(camp, px);
        }

        return null;
    }
}
